<?php
if(!defined('IN_THANKPHP_SYSTEM')) exit('Access Denied!');

abstract class model extends base {
	protected $link;
	protected $error_msg;
	protected $handle;
	protected $insert_id;
	protected $result;
	private	$debug = true;
	abstract function parse($array, $type);
	
	public function __construct($config){
		$this->connect($config);
	}
	
	public function setDebug($bool = FALSE){
		return $this->debug = $bool;
	}
	
	public function getDebug(){
		return $this->debug;
	}

	public function connect($config){
		return $this->link;
	}
	
	public function query($sql){
		return $this->handle;
	}
	
	public function update($table, $array){
		return $this->handle;
	}
	
	public function insert($table, $array){
		return $this->handle;
	}
	
	public function insertId(){
		return $this->insert_id;
	}
	
	public function delete($table, $condition){
		return $this->handle;
	}
	
	public function getOne(){
		return $this->result;
	}
	
	public function fetchArray(){
		return $this->result;
	}
	
	public function error($error){
		return $this->error_msg;
	}
}